package bp.wf.httphandler;

import bp.da.*;
import bp.wf.template.*;
import bp.wf.template.frm.*;
import bp.difference.*;
import bp.*;
import bp.wf.*;

/** 
 页面功能实体
*/
public class WF_Admin_FoolFormDesigner_PrintTemplate extends bp.difference.handler.WebContralBase
{
	/** 
	 构造函数
	*/
	public WF_Admin_FoolFormDesigner_PrintTemplate() throws Exception {
	}


		///#region  单据模版维护
	/** 
	 @李国文.
	 
	 @return 
	*/
//	public final String Bill_Save() throws Exception {
//		FrmPrintTemplate bt = new FrmPrintTemplate();
//
//		if (HttpContextHelper.RequestFilesCount == 0)
//		{
//			return "err@请上传模版.";
//		}
//		//上传附件
//		String filepath = "";
//		//HttpPostedFile file = HttpContext.Current.Request.Files[0];
//		//HttpPostedFile file = HttpContextHelper.RequestFiles(0);
//		var file = HttpContextHelper.RequestFiles(0);
//		String fileName = file.FileName;
//		fileName = fileName.substring(fileName.indexOf(this.GetRequestVal("TB_Name")));
//		fileName = fileName.toLowerCase();
//
//		filepath = SystemConfig.getPathOfDataUser() + "CyclostyleFile/" + fileName;
//		//file.SaveAs(filepath);
//		HttpContextHelper.UploadFile(file, filepath);
//
//		bt.setNodeID(this.getFK_Node());
//		bt.setFrmID(this.getFK_MapData());
//		bt.setMyPK(this.GetRequestVal("TB_No"));
//
//		if (DataType.IsNullOrEmpty(bt.getMyPK()))
//		{
//			bt.setMyPK(String.valueOf(DBAccess.GenerOID("Template")));
//		}
//
//		bt.setName(this.GetRequestVal("TB_Name"));
//		bt.setTempFilePath(fileName); //文件.
//
//		//打印的文件类型.
//		bt.setHisPrintFileType(PrintFileType.forValue(this.GetRequestValInt("DDL_BillFileType")));
//
//		//打开模式.
//		bt.setPrintOpenModel(PrintOpenModel.forValue(this.GetRequestValInt("DDL_BillOpenModel")));
//
//		//二维码模式.
//		bt.setQRModel(QRModel.forValue(this.GetRequestValInt("DDL_QRModel")));
//
//		bt.setTemplateFileModel(TemplateFileModel.forValue(this.GetRequestValInt("TemplateFileModel")));
//
//
//		bt.Save();
//
//		bt.SaveFileToDB("DBFile", filepath); //把文件保存到数据库里.
//
//		return "保存成功.";
//	}
//	/**
//	 下载文件.
//	*/
//	public final void Bill_Download() throws Exception {
//		FrmPrintTemplate en = new FrmPrintTemplate(this.getNo());
//		String MyFilePath = en.getTempFilePath();
//		//HttpResponse response = context.Response;
//		//response.Clear();
//		//response.Buffer = true;
//		//response.Charset = "utf-8";
//		//response.AppendHeader("Content-Disposition", string.Format("attachment;filename={0}", en.TempFilePath.Substring(MyFilePath.LastIndexOf('/') + 1)));
//		//response.ContentEncoding = "UTF-8";
//		//response.BinaryWrite(System.IO.File.ReadAllBytes(MyFilePath));
//		//response.End();
//
//		HttpContextHelper.ResponseWrite("Charset");
//		HttpContextHelper.ResponseWriteHeader("Content-Disposition", String.format("attachment;filename=%1$s", en.getTempFilePath().substring(MyFilePath.lastIndexOf('/') + 1)));
//		HttpContextHelper.Response.ContentType = "application/octet-stream;charset=utf-8";
//		HttpContextHelper.ResponseWriteFile(MyFilePath, null, "application/octet-stream");
//	}
//
//		///#endregion

}